package lambda;

import java.io.File;

public class Test {
    public static void main(String[] args) {

        File dir = new File("./");
        File[] subs = dir.listFiles(pathname -> pathname.getName().contains("o") );
        for (int i = 0; i < subs.length; i++) {
            System.out.println(subs[i].getName());
        }
      /*
       增强for循环
       for (File sub : subs) {
            System.out.println(sub.getName());
        }
        */
    }
}
